package cn.xwt.weidisk.service.impl;

import cn.xwt.weidisk.mapper.LinkMapper;

import cn.xwt.weidisk.pojo.dao.LinkDo;
import cn.xwt.weidisk.service.LinkService;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;


/**
 * @author 薛慰涛
 */
@Service("linkService")
public class LinkServiceImpl implements LinkService {

    @Resource
    LinkMapper linkMapper;

    final int insertSuccess = 1;

    @Override
    public List<LinkDo> selectLinkList(Long cid, Long uid) {
        return linkMapper.selectLinkList(cid, uid);
    }

    @Override
    public boolean insertLink(LinkDo link) {
        return linkMapper.insertLink(link) == insertSuccess;
    }

    @Override
    public Long count(Long cid) {
        return linkMapper.count(cid);
    }

    @Override
    public void deleteLink(LinkDo link) {
        linkMapper.deleteLink(link);
    }

    @Override
    public void updateLink(LinkDo link) {
        linkMapper.updateLink(link);
    }
}
